add_compile_definitions(APP_BRAND="${PROJECT_NAME}")
file(GLOB_RECURSE source_files
        main.cpp
        mainwindow.ui
        applet.h
        Applet.cpp
        ${CMAKE_SOURCE_DIR}/resource/client.qrc
        log.cpp
        util/tool.cpp
        view/home_view.cpp
        view/home_view.ui
        view/home_view.h
        view/setting_view.cpp
        view/setting_view.ui
        view/setting_view.h
        view/task_view.cpp
        view/task_view.ui
        view/task_view.h
)
set(QT_LIBRARIES
        Qt${QT_VERSION_MAJOR}::Core
        Qt${QT_VERSION_MAJOR}::Gui
        Qt${QT_VERSION_MAJOR}::Widgets
        Qt${QT_VERSION_MAJOR}::Network
        Qt${QT_VERSION_MAJOR}::Svg
)

if (QT_VERSION_MAJOR GREATER_EQUAL 6)
    set(QT_LIBRARIES ${QT_LIBRARIES} Qt${QT_VERSION_MAJOR}::Core5Compat)
endif ()
set(TARGET_LIBS
        ${QT_LIBRARIES}
)

set(EXTERN_LIBRARY ${QRENCODE_LIBRARIES})

set(TS_FILES ./translations/en.ts)
qt5_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${TS_FILES})

add_executable(${PROJECT_NAME}
        ${GUI_TYPE}
        ${WIN32_RESOURCES}
        ${QM_FILES}
        ${source_files}
)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)


target_sources(${PROJECT_NAME} PRIVATE ${source_files})
PackTarget(${PROJECT_NAME})
target_include_directories(${PROJECT_NAME}
        PUBLIC
        ${CMAKE_CURRENT_LIST_DIR}
        ${QRENCODE_INCLUDE_DIR}
)

target_link_libraries(${PROJECT_NAME}
        PRIVATE
        ${TARGET_LIBS}
)
